package com.inplaceedit.client.place;

import com.core.gwt.place.client.PlaceToken;
import com.core.gwt.place.client.PlaceType;
import com.core.gwt.place.client.PlaceWithType;
import com.inplaceedit.client.support.ApplicationPlace;

public class CompanyDetailsPlace extends ApplicationPlace {
	private static final String PREFIX = "company/details";

	public static final PlaceType TYPE = new PlaceType() {

		@Override
		public PlaceWithType getPlace(final String token) {
			return new CompanyDetailsPlace(token);
		}

		@Override
		public String getPrefix() {
			return PREFIX;
		}
	};

	private String id;

	public CompanyDetailsPlace() {
		super();
	}

	public CompanyDetailsPlace(final String token) {
		super(token);
	}

	public String getId() {
		return id;
	}

	@Override
	public PlaceType getType() {
		return TYPE;
	}

	public void setId(final String id) {
		this.id = id;
	}

	@Override
	protected void loadState(final PlaceToken token) {
		super.loadState(token);
		id = token.getString("id");
	}

	@Override
	protected void saveState(final PlaceToken token) {
		super.saveState(token);
		token.setString("id", id);
	}
}
